package com.shaokel.repository;

import com.shaokel.pojo.Tag;

import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @author 少丶客
 * @ClassName TagRepository
 * @Description TODO
 * @Date 2020/6/26 12:48
 * @Vesion 1.0
 */
public interface TagRepository extends JpaRepository<Tag,Long> {

    //更加名称查找
    Tag findByName(String name);

    @Query("select t from Tag t")
    List<Tag> findTop(Pageable pageable);
}